home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / gcc-2.003 / gcc-2 / README
Encoding:
Text File  |  1995-09-08  |  1.9 KB  |  47 lines

  1.  
  2. Here's another quick hack for you...
  3.  
  4. I recently converted to Linux/DJGPP a software project originally started
  5. in Borland C under MS-DOG; but the project is continuously going on and,
  6. worse, the other people working on it don't want to switch to Linux :-(
  7. So I have to keep the source tree under DOS.
  8.  
  9. I was tired of continuously running fromdos/todos any time I had to compile
  10. a new version, and at the same time I wanted to keep only one source tree.
  11.  
  12. So I asked myself, since the sources for this project are the same under
  13. DOS and Linux, why gcc can't directly use the DOS sources?
  14. It turns out that it can, with some limits.
  15.  
  16. The CR (\r) character is ignored by gcc; but it becomes significant
  17. when the EOL is escaped: the sequence backslash\r\n is not recognized
  18. as a valid continuation for a line, and gives an error.
  19.  
  20. I could of course filter and preprocess the source and then feed gcc with
  21. the .i file, but I decided to take a look at the cpp sources. The result
  22. is this small patch to cccp.c which makes the C preprocessor accept any
  23. kind of EOL sequence.
  24. Briefly, it converts \r\n to \n<space>, and \r alone to \n. \n\r (is this
  25. used?) is converted to \n\n.
  26.  
  27. To activate this feature add
  28.     -imsdos
  29. to your CFLAGS (feel free to use a better name :-)
  30.  
  31. The patch is against gcc-2.7.0.
  32. I included also a binary version of the modified cpp. This is in ELF
  33. format; I was not able to produce an a.out binary (usual troubles with
  34. beta software...). So if you want the a.out version:
  35.     get the gcc-2.7.0 sources and unpack them
  36.     enter the gcc directory and apply the patch (or replace
  37.      cccp.c with the one provided here)
  38.     follow the instructions to configure gcc
  39.     make cpp        /* this is enough, don't make all! */
  40.  
  41. I don't think many people use shared DOS/Linux sources, but who knows.
  42. Please tell me (and gcc developers, of course) if you find this patch
  43. useful.
  44.  
  45. Alberto            <a.vignani@crf.it>
  46.  
  47.